<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<%
    request.setAttribute("PAGE_TITLE", "预约");
%>
<jsp:include page="../../include/head.jsp"/>
<form class="form-horizontal" name="myForm" id="myForm" action="${BasePath}/order/order/extendValidity" method="post">
    <table id="edittable" style="width:100%;" align="center">
        <tr>
            <td colspan="2" class="column_head" style="font-size:14px;font-weight:bold;height:20px;">
                批量延期
                <input type="hidden" name="ids" id="ids" value="${ids}"/>
            </td>
        </tr>
        <tr>
            <td class="column_name">
                预约日期
            </td>
            <td class="column_input">
                <input type="text" id="extendDate" name="extendDate" value=""
                       class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-%d',readOnly:'false'})"/>
            </td>
        <tr>
            <td colspan="2" class="column_bottom">
                <input name="submit" id="submitbut" type="button" value="提交" onclick="doExtend()"/>
                <input name="reset" type="reset" id="reset" value="重置"/>
            </td>
        </tr>
    </table>
    <input type="hidden" id="groupOrderId" name="groupOrderId" value="${order.groupOrderId}"/>
</form>
</body>
</html>
<script>
    function doExtend() {
        var extendDate = $("#extendDate").val();
        if (extendDate == "") {
            layer.msg('请选择日期!', {icon: 5});
            return false;
        }
        $('#myForm').ajaxSubmit(function (data) {
            if (data.errno == 1) {
                alert(data.errdesc);
            } else {
                alert("操作成功");
                window.parent.document.getElementById("myForm").submit();
            }
        });
    }
</script>
